// import axios from 'axios';
// const service = axios.create({
//     baseURL: process.env.NODE_ENV === 'development' ? '/loaclApi' : '线上完整地址',
//     timeout: 5000
// });
// export default service;

// 支持多个后端端口
import axios from 'axios'
function request(config) {
    //1.创建axios实例
    const instance1 = axios.create({
        timeout: 10 * 60 * 1000,
        baseURL: process.env.VUE_APP_BASE_API1
    })
    //2.再创建一个axios实例，用来放第二个baseURL
    const instance2 = axios.create({
        timeout: 10 * 60 * 1000,
        baseURL: process.env.VUE_APP_BASE_API2
    })
    //3.再创建一个axios实例，用来放第三个baseURL
    const instance3 = axios.create({
        timeout: 10 * 60 * 1000,
        baseURL: process.env.VUE_APP_BASE_API3
    })

    const instance4 = axios.create({
        timeout: 10 * 60 * 1000,
        baseURL: process.env.VUE_APP_BASE_API4,
        auth: {
            username: 'password',
            password: '1ef130b4-e4f8-4d30-8743-7cc09ce249d6'
        }
    })

    const instance5 = axios.create({
        timeout: 10 * 60 * 1000,
        baseURL: process.env.VUE_APP_BASE_API5,
    })
    //发送真正的网络请求
    return [instance1, instance2, instance3, instance4, instance5]
}
export default request()
